package cn.bx.spring.inter;

import cn.bx.spring.dao.UserDao;
import cn.bx.spring.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("app2.xml");
        UserDao userDao=ac.getBean(UserDao.class);
        System.out.println(userDao.getClass()+">>>");
        User u=new User("h001","钢铁","3333");
        userDao.add(u);
        System.out.println("执行结束了");
        boolean del=userDao.del("laoliu");
        System.out.println("删除结果："+del);

        /*Garden g = (Garden) ac.getBean("g");
        g.introduction();*/
    }
}
